<?php echo $this->render("header.phtml"); ?>
<label class="title">Member control - Change password</label>
<div class="horiz_sep">&nbsp;</div>
<form action="<? echo $this -> baseUrl ?>/<?= $this->contextPath ?>/change-password" method="post">
<table cellpadding="0" cellspacing="5" width="100%" border="0">
<?php
	if (isset($this->errors)){
		$errors = $this->errors;	
		if (array_key_exists('old_password_incorrect', $errors)) $old_pass_incorrect = $errors['old_password_incorrect'];
		else $old_pass_incorrect = "";
		if (array_key_exists('old_password_null', $errors)) $old_password_null = $errors['old_password_null'];
		else $old_password_null = "";
		if (array_key_exists('confirm_password_incorrect', $errors)) $confirm_pass_incorrect = $errors['confirm_password_incorrect'];
		else $confirm_pass_incorrect = "";			
		if (array_key_exists('password_length_incorrect', $errors)) $password_length_incorrect = $errors['password_length_incorrect'];
		else $password_length_incorrect = "";
	}
?>
	<tr>
    	<th width="30%" align="right">Old password:</th>
    	<td>
    		<input type="password" name="old_password" value="" style="padding:2px;"/>    		
    		<?php if (isset($old_pass_incorrect)){ ?>
				<span style="color:red; font-weight:bold;"><?php echo $old_pass_incorrect; ?></span>
			<?php } ?>
			<?php if (isset($old_password_null)){ ?>
				<span style="color:red; font-weight:bold;"><?php echo $old_password_null; ?></span>
			<?php } ?>
    	</td>
  	</tr>
  	<tr>
    	<th align="right">New password:</th>
    	<td>
    		<input type="password" name="new_password" value="" style="padding:2px;"/>    		
    		<?php if (isset($password_length_incorrect)){ ?>
				<span style="color:red; font-weight:bold;"><?php echo $password_length_incorrect; ?></span>
			<?php } ?>
    	</td>
  	</tr>
  	<tr>
    	<th align="right">Confirm new password:</th>
    	<td>
    		<input type="password" name="confirm_new_password" value="" style="padding:2px;"/>    		
    		<?php if (isset($confirm_pass_incorrect)){ ?>
				<span style="color:red; font-weight:bold;"><?php echo $confirm_pass_incorrect; ?></span>
			<?php } ?>
    	</td>
  	</tr>
  	<tr>
    	<th></th>
    	<td><input type="submit" name="save" value="Save"/></td>
  	</tr>
</table>
</form>
<?php echo $this->render("footer.phtml"); ?>